﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BAL.Entities;
using BAL.Utils;
using BAL.Components;

namespace DigitalAnts.Admin
{
    public partial class EmployeeLogin : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            {
            
            }
        }

        protected void bttlogin_Click(object sender, EventArgs e)
        {
            clsEmployee obj = new clsEmployee();
            obj.UserName = txt_username.Text.Trim();
            obj.Password = clsSecurity.doEncryptPasswordWithMD5(txt_pass.Text.Trim());
            if (clsEmployeeBAL.doAdminLogin(obj) == true)
            {
                Session["AdminUser"] = txt_username.Text;
                Session["Role"] = "admin";
                Response.Redirect("~/Admin/HomeAdmin.aspx");
            }
            else
            {
                lbl_mess.Text = "Login Fail";
            }
        }
    }
}